<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>测试 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="测试。Test。">
<meta property="og:type" content="article">
<meta property="og:title" content="测试">
<meta property="og:url" content="http://example.com/2020/08/05/%E6%B5%8B%E8%AF%95/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="测试。Test。">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-08-05T13:20:53.887Z">
<meta property="article:modified_time" content="2023-07-19T11:50:13.373Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css">

  
  
<meta name="generator" content="Hexo 6.3.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"><span class="fa fa-bars"></span></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
        
          <a class="nav-icon" href="/atom.xml" title="RSS Feed"><span class="fa fa-rss"></span></a>
        
        <a class="nav-icon nav-search-btn" title="Search"><span class="fa fa-search"></span></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://example.com"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-测试" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2020/08/05/%E6%B5%8B%E8%AF%95/" class="article-date">
  <time class="dt-published" datetime="2020-08-05T13:20:53.887Z" itemprop="datePublished">2020-08-05</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="p-name article-title" itemprop="headline name">
      测试
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p>测试。Test。</p>
<p>我能吞下玻璃而不伤身体。<br>I can eat glass, it doesn’t hurt me.</p>
<p><em>我能吞下玻璃而不伤身体。<br>I can eat glass, it doesn’t hurt me.</em></p>
<p><strong>我能吞下玻璃而不伤身体。<br>I can eat glass, it doesn’t hurt me.</strong></p>
<p><strong><em>我能吞下玻璃而不伤身体。<br>I can eat glass, it doesn’t hurt me.</em></strong></p>
<p><del>我能吞下玻璃而不伤身体。<br>I can eat glass, it doesn’t hurt me.</del></p>
<p>1.我能吞下玻璃而不伤身体。<br>2.I can eat glass, it doesn’t hurt me.</p>
<ul>
<li>我能吞下玻璃而不伤身体。</li>
<li>I can eat glass, it doesn’t hurt me.</li>
</ul>
<blockquote>
<p>我能吞下玻璃而不伤身体。<br>I can eat glass, it doesn’t hurt me.</p>
</blockquote>
<h1 id="我能吞下玻璃而不伤身体。"><a href="#我能吞下玻璃而不伤身体。" class="headerlink" title="我能吞下玻璃而不伤身体。"></a>我能吞下玻璃而不伤身体。</h1><h1 id="I-can-eat-glass-it-doesn’t-hurt-me"><a href="#I-can-eat-glass-it-doesn’t-hurt-me" class="headerlink" title="I can eat glass, it doesn’t hurt me."></a>I can eat glass, it doesn’t hurt me.</h1><h2 id="我能吞下玻璃而不伤身体。-1"><a href="#我能吞下玻璃而不伤身体。-1" class="headerlink" title="我能吞下玻璃而不伤身体。"></a>我能吞下玻璃而不伤身体。</h2><h2 id="I-can-eat-glass-it-doesn’t-hurt-me-1"><a href="#I-can-eat-glass-it-doesn’t-hurt-me-1" class="headerlink" title="I can eat glass, it doesn’t hurt me."></a>I can eat glass, it doesn’t hurt me.</h2><h3 id="我能吞下玻璃而不伤身体。-2"><a href="#我能吞下玻璃而不伤身体。-2" class="headerlink" title="我能吞下玻璃而不伤身体。"></a>我能吞下玻璃而不伤身体。</h3><h3 id="I-can-eat-glass-it-doesn’t-hurt-me-2"><a href="#I-can-eat-glass-it-doesn’t-hurt-me-2" class="headerlink" title="I can eat glass, it doesn’t hurt me."></a>I can eat glass, it doesn’t hurt me.</h3><h4 id="我能吞下玻璃而不伤身体。-3"><a href="#我能吞下玻璃而不伤身体。-3" class="headerlink" title="我能吞下玻璃而不伤身体。"></a>我能吞下玻璃而不伤身体。</h4><h4 id="I-can-eat-glass-it-doesn’t-hurt-me-3"><a href="#I-can-eat-glass-it-doesn’t-hurt-me-3" class="headerlink" title="I can eat glass, it doesn’t hurt me."></a>I can eat glass, it doesn’t hurt me.</h4><p>$dp(j)=min(dp(j),dp(j-w[i])+v[i])$</p>
<script type="math/tex; mode=display">dp(j)=min(dp(j),dp(j-w[i])+v[i])</script><p>$1 \le 2$</p>
<script type="math/tex; mode=display">1 \le 2</script><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;bits/stdc++.h&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"><span class="meta">#<span class="keyword">define</span> MAXN 100005</span></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> F 15</span></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> R 200</span></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> INF 0x7fffffff</span></span><br><span class="line">vector&lt;pair&lt;<span class="type">int</span>,<span class="type">int</span>&gt; &gt; g[MAXN];</span><br><span class="line"><span class="type">int</span> n,m,s,dis[MAXN],cnt[MAXN];</span><br><span class="line"><span class="function"><span class="keyword">inline</span> <span class="type">int</span> <span class="title">read</span><span class="params">()</span></span>&#123;</span><br><span class="line">   <span class="type">int</span> s=<span class="number">0</span>,w=<span class="number">1</span>;</span><br><span class="line">   <span class="type">char</span> ch=<span class="built_in">getchar</span>();</span><br><span class="line">   <span class="keyword">while</span>(ch&lt;<span class="string">&#x27;0&#x27;</span>||ch&gt;<span class="string">&#x27;9&#x27;</span>)&#123;<span class="keyword">if</span>(ch==<span class="string">&#x27;-&#x27;</span>)w=<span class="number">-1</span>;ch=<span class="built_in">getchar</span>();&#125;</span><br><span class="line">   <span class="keyword">while</span>(ch&gt;=<span class="string">&#x27;0&#x27;</span>&amp;&amp;ch&lt;=<span class="string">&#x27;9&#x27;</span>) s=s*<span class="number">10</span>+ch-<span class="string">&#x27;0&#x27;</span>,ch=<span class="built_in">getchar</span>();</span><br><span class="line">   <span class="keyword">return</span> s*w;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function"><span class="type">void</span> <span class="title">SPFA</span><span class="params">()</span></span>&#123;</span><br><span class="line">    deque&lt;<span class="type">int</span>&gt; q;</span><br><span class="line">    q.<span class="built_in">push_back</span>(s);</span><br><span class="line">    <span class="keyword">while</span>(!q.<span class="built_in">empty</span>())&#123;</span><br><span class="line">        <span class="type">int</span> u=q.<span class="built_in">front</span>();</span><br><span class="line">        q.<span class="built_in">pop_front</span>();</span><br><span class="line">        <span class="keyword">for</span>(<span class="type">int</span> i=<span class="number">0</span>;i&lt;g[u].<span class="built_in">size</span>();i++)&#123;</span><br><span class="line">            <span class="type">int</span> v=g[u][i].first,w=g[u][i].second;</span><br><span class="line">            <span class="keyword">if</span>(dis[v]&gt;dis[u]+w)&#123;</span><br><span class="line">                dis[v]=dis[u]+w;</span><br><span class="line">                <span class="keyword">if</span>(cnt[v]&gt;R)&#123;</span><br><span class="line">                    q.<span class="built_in">push_back</span>(v);</span><br><span class="line">                &#125;<span class="keyword">else</span> <span class="keyword">if</span>(dis[q.<span class="built_in">front</span>()]&gt;=dis[v]-F)&#123;</span><br><span class="line">                    q.<span class="built_in">push_front</span>(v);</span><br><span class="line">                &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">                    q.<span class="built_in">push_back</span>(v);</span><br><span class="line">                &#125;</span><br><span class="line">                cnt[v]++;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function"><span class="type">int</span> <span class="title">main</span><span class="params">()</span></span>&#123;</span><br><span class="line">    <span class="built_in">srand</span>(<span class="built_in">time</span>(<span class="literal">NULL</span>));</span><br><span class="line">    n=<span class="built_in">read</span>();</span><br><span class="line">    m=<span class="built_in">read</span>();</span><br><span class="line">    s=<span class="built_in">read</span>();</span><br><span class="line">    <span class="keyword">for</span>(<span class="type">int</span> i=<span class="number">1</span>;i&lt;=m;i++)&#123;</span><br><span class="line">        <span class="type">int</span> u,v,w;</span><br><span class="line">        u=<span class="built_in">read</span>();</span><br><span class="line">        v=<span class="built_in">read</span>();</span><br><span class="line">        w=<span class="built_in">read</span>();</span><br><span class="line">        g[u].<span class="built_in">push_back</span>(<span class="built_in">make_pair</span>(v,w));</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">for</span>(<span class="type">int</span> i=<span class="number">1</span>;i&lt;=n;i++)&#123;</span><br><span class="line">        <span class="built_in">random_shuffle</span>(g[i].<span class="built_in">begin</span>(),g[i].<span class="built_in">end</span>());</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="built_in">fill</span>(dis+<span class="number">1</span>,dis+<span class="number">1</span>+n,INF);</span><br><span class="line">    dis[s]=<span class="number">0</span>;</span><br><span class="line">    <span class="built_in">SPFA</span>();</span><br><span class="line">    <span class="keyword">for</span>(<span class="type">int</span> i=<span class="number">1</span>;i&lt;=n;i++)&#123;</span><br><span class="line">        <span class="built_in">printf</span>(<span class="string">&quot;%d &quot;</span>,dis[i]);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">&quot;\n&quot;</span>);</span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://example.com/2020/08/05/%E6%B5%8B%E8%AF%95/" data-id="clk9o8ln8000g8wi5gt539l0p" data-title="测试" class="article-share-link"><span class="fa fa-share">Share</span></a>
      
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2020/08/06/%E3%80%8C%E7%8A%B6%E5%8E%8BDP%E3%80%8DP1441%20%E9%A2%98%E8%A7%A3%20%E7%A0%9D%E7%A0%81%E7%A7%B0%E9%87%8D/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          「状压DP」P1441 题解 砝码称重
        
      </div>
    </a>
  
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/07/">July 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/10/">October 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/05/">May 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/02/">February 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/01/">January 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/08/">August 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/07/">July 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/06/">June 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/08/">August 2020</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2023/07/17/%E5%86%B3%E7%AD%96%E5%8D%95%E8%B0%83%E6%80%A7%E4%BC%98%E5%8C%96DP%20%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%20AND%20P4767%20%E3%80%8CIOI2000%E3%80%8D%20%E9%82%AE%E5%B1%80%20%E9%A2%98%E8%A7%A3/">决策单调性优化DP 学习笔记 AND P4767 「IOI2000」 邮局 题解</a>
          </li>
        
          <li>
            <a href="/2022/10/30/CSP-S%202022%20%E6%B8%B8%E8%AE%B0/">CSP-S 2022 游记</a>
          </li>
        
          <li>
            <a href="/2022/05/29/%E6%96%9C%E7%8E%87%E4%BC%98%E5%8C%96%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92%20%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">斜率优化动态规划 学习笔记</a>
          </li>
        
          <li>
            <a href="/2022/05/22/PKUSC%E4%B8%80%E5%8F%A5%E8%AF%9D%E6%B8%B8%E8%AE%B0/">PKUSC一句话游记</a>
          </li>
        
          <li>
            <a href="/2022/05/18/%E7%9C%81%E9%80%89%E6%B8%B8%E8%AE%B0%EF%BC%9F%E7%9C%81%E9%80%89%E6%B8%B8%E5%AF%84%EF%BC%81/">省选游记？省选游寄！</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2023 John Doe<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/js/jquery-3.6.4.min.js"></script>



  
<script src="/fancybox/jquery.fancybox.min.js"></script>




<script src="/js/script.js"></script>





  </div>
</body>
</html>